package com.ruoyi.web.sso.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.web.sso.mapper.PushAddressMapper;
import com.ruoyi.web.sso.domain.PushAddress;
import com.ruoyi.web.sso.service.IPushAddressService;
import com.ruoyi.common.core.text.Convert;

/**
 * 设备地址信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-02-23
 */
@Service
public class PushAddressServiceImpl implements IPushAddressService 
{
    @Autowired
    private PushAddressMapper pushAddressMapper;

    /**
     * 查询设备地址信息
     * 
     * @param id 设备地址信息主键
     * @return 设备地址信息
     */
    @Override
    public PushAddress selectPushAddressById(String id)
    {
        return pushAddressMapper.selectPushAddressById(id);
    }

    /**
     * 查询设备地址信息列表
     * 
     * @param pushAddress 设备地址信息
     * @return 设备地址信息
     */
    @Override
    public List<PushAddress> selectPushAddressList(PushAddress pushAddress)
    {
        return pushAddressMapper.selectPushAddressList(pushAddress);
    }

    /**
     * 新增设备地址信息
     * 
     * @param pushAddress 设备地址信息
     * @return 结果
     */
    @Override
    public int insertPushAddress(PushAddress pushAddress)
    {
        pushAddress.setCreateTime(DateUtils.getNowDate());
        return pushAddressMapper.insertPushAddress(pushAddress);
    }

    /**
     * 修改设备地址信息
     * 
     * @param pushAddress 设备地址信息
     * @return 结果
     */
    @Override
    public int updatePushAddress(PushAddress pushAddress)
    {
        pushAddress.setUpdateTime(DateUtils.getNowDate());
        return pushAddressMapper.updatePushAddress(pushAddress);
    }

    /**
     * 批量删除设备地址信息
     * 
     * @param ids 需要删除的设备地址信息主键
     * @return 结果
     */
    @Override
    public int deletePushAddressByIds(String ids)
    {
        return pushAddressMapper.deletePushAddressByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除设备地址信息信息
     * 
     * @param id 设备地址信息主键
     * @return 结果
     */
    @Override
    public int deletePushAddressById(String id)
    {
        return pushAddressMapper.deletePushAddressById(id);
    }
}
